package org.phalanx.testing;

import org.jivesoftware.smack.packet.Message;
import org.phalanx.messenging.management.MessageListener;
import org.phalanx.messenging.management.MessageManager;
import org.phalanx.messenging.management.PhalanxMetaMessage;

public class testListener implements MessageListener {

	public static void main(String[] args) {
		MessageManager p = new MessageManager();

		p.addMessageListener(new TestMessage(), new testListener());
		
		Message newXMPPMsg = new Message();
		
		newXMPPMsg.setSubject("TEST");
		newXMPPMsg.setBody("A=90,B=40");
		newXMPPMsg.setFrom("Paco");
		
		//p.receiveMessage(newXMPPMsg);
	}
	
	public void processMessage(TestMessage msg, PhalanxMetaMessage pmMsg){
		System.out.println("Test Message:");
		System.out.println();
		System.out.println("From: " + pmMsg.getUserName());
		System.out.println("A = " + msg.getA());
		System.out.print("B = " + msg.getFromMessage("B"));
	}
}
